package com.zyb.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.zyb.domain.Brand;
import com.zyb.domain.Goods;
import com.zyb.domain.Type;

public interface GoodsDao {
	/**
	 * 
	 * @Title: list
	 * @Description: 列表
	 * @return
	 * @return: List<Goods>
	 */
	List<Goods> list();

	@Insert("insert into t_goods values(null,#{name},#{price},#{ename},#{size},#{store},#{tag},#{picture},#{brandId},#{typeId})")
	int add(Goods goods);
	@Select("select * from t_brand")
	List<Brand> brands();
	@Select("select * from t_type")
	List<Type> types();

	Goods toUpda(Integer id);
	@Update("update t_goods set name=#{name},price=#{price},ename=#{ename},size=#{size},store=#{store},tag=#{tag},picture=#{picture},brand_id=#{brandId},type_id=#{typeId} where id=#{id}")
	int update(Goods goods);
	@Delete("delete from t_goods where id=#{id}")
	int dele(Integer id);
}
